package cn.ronghuanet;

import cn.ronghuanet.base.interceptors.AuthenticInterceptor;
import org.apache.ibatis.annotations.Mapper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@SpringBootApplication
@MapperScan("cn.ronghuanet.*.mapper")
//@ServletComponentScan("cn.ronghuanet.base.listener")
public class App implements WebMvcConfigurer {
    @Autowired
    private AuthenticInterceptor authenticInterceptor;

    public static void main(String[] args) {
        SpringApplication.run(App.class,args);
    }

//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        registry.addInterceptor(authenticInterceptor)
//                .addPathPatterns("/**")
//                .excludePathPatterns("/login","loginOut");
//    }
}
